// docker build - t nginx: v3.


const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const { exec } = require('child_process');
const { spawnSync } = require('child_process'); // 输出文件夹列表
const [, , ...args] = [...process.argv];



const branch = (process.env.GIT_BRANCH || '').replace('origin/', '').replace('\n', '');

console.log(`Branch:${branch}`);


// const BRANCH_PATH = branch ? `./dist/${branch}/dist` : `./dist`;

execSync(`docker build --build-arg BRANCH_PATH="./" -t ${branch}:latest . `, {
    cwd: process.cwd(),
    stdio: 'inherit',
});
// execSync(`docker build --build-arg BRANCH_PATH="${BRANCH_PATH}" -t harbor.peoplus.cn/f2e/venus/venus-frontend/${branch}:${time} .`, {
//     cwd: process.cwd(),
//     stdio: 'inherit',
// });